package com.yfp.group.service.impl;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yfp.group.domain.EnterpriseOrderDetails;
import com.yfp.group.domain.vo.EnterpriseOrderClientVO;
import com.yfp.group.service.EnterpriseOrderDetailsService;
import com.yfp.group.mapper.EnterpriseOrderDetailsMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author admin
 * @description 针对表【enterprise_order_details(企业订单明细)】的数据库操作Service实现
 * @createDate 2024-08-10 09:43:43
 */
@Service
public class EnterpriseOrderDetailsServiceImpl extends ServiceImpl<EnterpriseOrderDetailsMapper, EnterpriseOrderDetails> implements EnterpriseOrderDetailsService {

    @Resource
    private EnterpriseOrderDetailsMapper enterpriseOrderDetailsMapper;

    @Override
    public List<EnterpriseOrderDetails> listByOrderSns(List<String> orderSnList) {
        if (CollUtil.isEmpty(orderSnList)) {
            return List.of();
        }
        return enterpriseOrderDetailsMapper.listByOrderSns(orderSnList);
    }

    @Override
    public EnterpriseOrderClientVO getComboInfo(EnterpriseOrderClientVO enterpriseOrderClientVO) {
        EnterpriseOrderClientVO orderClientVOS = enterpriseOrderDetailsMapper.getComboInfo(enterpriseOrderClientVO);
        return orderClientVOS;
    }

    @Override
    public Integer getComboNum(String enterpriseOrderSn) {
        return enterpriseOrderDetailsMapper.getComboNum(enterpriseOrderSn);
    }
}




